@extends('layout.default')

@section('layout.content')

  <div class="row">
    <div class="col-xs-12">
      <form method="get" class="form-horizontal">
        <div class="space-12"></div>
        <div class="col-xs-12 col-md-6 col-md-offset-3">
          <div class="form-group">
            <div class="input-group">
              <input type="text" class="form-control" id="account" name="account" maxlength="13" placeholder="帐号"
                     style="padding:0 10px;height:45px;font-size:18px;font-weight: bold;" autocomplete="off"/>
              <span class="input-group-btn">
                <button class="btn btn-primary submit" id="btn-sign" type="button" style="height:45px;font-size:14px;">
                  <i class="ace-icon fa fa-search"></i>
                  信息确认
                </button>            
              </span>
            </div>
          </div>
        </div>
      </form>
    </div>
  </div><!-- /.row -->

@stop

@section('javascript')
  <script type="text/javascript">
      $(function () {
          $("#account").focus();

          $('.submit').on('click', function () {

              var uri = '{{route('point.gift.check')}}';

              $.post(uri, {
                  '_token': $("input[name='_token']").attr('value'),
                  'account': $("input[name='account']").val(),
              }, function (data) {
                  console.log(data);
                  layer.msg(data.message, {shift: -1}, function () {
                      if (data.status === true && data.url != null) {
                          $(window).attr('location', data.url);
                      }
                  });

              }, 'json').error(function (data) {
                  console.log(data);
                  layer.msg(data.responseJSON.message);
              });

          });
      });
  </script>
@stop